﻿using DevExpress.XtraReports.UI;
using EyFramework.Common;
using ShuJuGj.Entity;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using tjyyjl.Core.Service;

namespace ShuJuGj.Report
{
    
    public partial class TjReport : DevExpress.XtraReports.UI.XtraReport
    {
        private ITjTjyyjlService tjTjyyjlService;
        public TjReport()
        {
            InitializeComponent();
        }

        public void PrintData(Inquire inquire)
        {
            tjTjyyjlService = Globals.GetService<ITjTjyyjlService>();
            double ZH = 0;
            if (inquire.daojiansjStart == "")
            {
                shijianbt.Text = "预约时间：";
                sj.Text = inquire.checkDateStart + "——" + inquire.checkDateEnd;
            }
            else 
            {
                shijianbt.Text = "到检时间：";
                sj.Text = inquire.daojiansjStart + "——" + inquire.daojiansjEnd;
            }
            czr.Text = "操作人：" + Globals.CurrentUser.StaffName;
            czsj.Text = "操作时间："+ DateTime.Now.ToString("yyyy-MM-dd");
            List<TjTjyyjl> list = tjTjyyjlService.GetListBy(inquire);
            for (int i = 0; i < list.Count; i++)
            {
                TjTjyyjl tjyyjl = list[i];
                Data.TjyyjlData.AllxxRow row = allData1.Allxx.NewAllxxRow();
                row.YYID = tjyyjl.serialNumber;
                row.XM = tjyyjl.name;
                row.TJMC = tjyyjl.hospitalPackageName;
                row.TJJX = tjyyjl.addCombinationName;
                row.TJFY = tjyyjl.examinationFee.ToString();
                if (!(tjyyjl.examinationFee.ToString() == ""))
                {
                    ZH = ZH + (double)tjyyjl.examinationFee;
                }
                this.allData1.Tables[0].Rows.Add(row);
            }
            lblnum.Text = "合计："+ZH.ToString("0.00");
        }

    }
}
